#include"wrinifile.h"
#include<QSettings>
#include<QTextCodec>
#include<QDebug>
void WriteIniFiles()
{
    QSettings settings("mytest.ini",QSettings::IniFormat);
    settings.setValue("/Network/Host","192.0.0.1");
    settings.setValue("/Network/Port",8080);
    settings.setValue("/Newtwork/Enabled",true);
    settings.setValue("/Newtwork/Name","张山");
    settings.beginGroup("DataBase");
    settings.setValue("Driver","QSQLITE");
    settings.endGroup();

    settings.setIniCodec(QTextCodec::codecForName("System"));
}
void ReadIniFiles()
{
       QSettings settings("mytest.ini", QSettings::IniFormat);//指定文件和格式
       settings.setIniCodec(QTextCodec::codecForName("System"));


       QString hs=settings.value("/Network/Host").toString();
       int pt=settings.value("/Network/Port").toInt();
       bool eb=settings.value("/Newtwork/Enabled").toBool();
       QString nm=settings.value("/Newtwork/Name").toString();
       qDebug()<<nm.toUtf8().data();




}
